package com.example.task1.ui.AllService.word;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.example.task1.bean.WordBean;

import java.util.List;

public class MoviesAdapter extends FragmentPagerAdapter {

    private List<WordBean> data;

    public MoviesAdapter(@NonNull FragmentManager fm,List<WordBean> rows) {
        super(fm);
        data = rows;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return data.get(position).getFragment();
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return data.get(position).getTitle();
    }
}
